package com.hand.prantice.ssm.controller;

import com.hand.prantice.ssm.domain.Role;
import com.hand.prantice.ssm.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 马旭阳
 * @date2019/7/16
 */

@RestController
@RequestMapping(value = "/role")
public class RoleController {
    @Autowired
    private IRoleService roleService;

    @GetMapping
    public List<Role> queryAllRole() {
        return roleService.queryAllRole();
    }
    @PutMapping
    public void insertRole(@RequestBody Role role) {
        roleService.insertRole(role);
    }
    @DeleteMapping
    public void deleteRole(@RequestParam("id") Long id) {
        roleService.deleteRole(id);
    }
    @PostMapping
    public void updateRole(@RequestParam("id") Long id) {
        roleService.updateRole(id);
    }
}
